package com.example.demo.demos.mapper;


import com.example.demo.demos.entity.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {

    @Select("select * from user")
    public List<User> queryAll();


    @Select("select * from user where username= #{username} ")
    public List<User> queryByName(String username);


    @Insert("insert into user values (#{id},#{username},#{password},#{birthday})")
    public int insert(User user);


    @Delete("delete from user where id = #{id}")
    public int delete(int id);
}
